home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 011 / ileave.arc / SHOWTIME.C < prev    next >
Encoding:
C/C++ Source or Header  |  1987-10-07  |  539 b   |  39 lines

  1. #include <stdio.h>
  2. #include <hamdefs.h>
  3.  
  4. showtime(r, c)
  5. int    r, c;
  6. {
  7.     int    h, m, s, hs;
  8.     int    hour;
  9.     char    string[20], desig;
  10.  
  11.     if (r < 0) {
  12.         clrblk((-r) - 1, c - 1, (-r) + 1, c + 8);
  13.         return 0;
  14.     }
  15.     getsytim(&h, &m, &s, &hs);
  16.  
  17.     hour = h;
  18.  
  19.     desig = 'a';
  20.  
  21.     if (h > 11)
  22.         desig = 'p';
  23.  
  24.     if (h == 0)
  25.         hour = 12;
  26.  
  27.     if (hour > 12)
  28.         hour -= 12;
  29.  
  30.     sprintf(string, "%2d:%02d %cm", hour, m, desig);
  31.     csrpush();
  32.     scrbox(r - 1, c - 1, r + 1, c + 8, 1, NORMAL);
  33.     atputsha(r, c, string);
  34.     csrpop();
  35.     return 0;
  36. }
  37.  
  38.  
  39.